package c.c.a;

import android.content.Context;
import android.content.Intent;
import android.os.IBinder;
import android.os.IInterface;
import c.c.a.k1.b;

public final class s0 extends q0<b> {

    public class a implements b<b, String> {
        public a(s0 s0Var) {
        }

        public Object a(IBinder iBinder) {
            int i = c.c.a.b.a.a;
            if (iBinder == null) {
                return null;
            }
            IInterface queryLocalInterface = iBinder.queryLocalInterface("com.bun.lib.MsaIdInterface");
            if (queryLocalInterface == null || !(queryLocalInterface instanceof b)) {
                return new c.c.a.b.a.a(iBinder);
            }
            return (b) queryLocalInterface;
        }

        public Object a(Object obj) {
            b bVar = (b) obj;
            if (bVar == null) {
                return null;
            }
            return bVar.c();
        }
    }

    public s0() {
        super("com.mdid.msa");
    }

    public b<b, String> a() {
        return new a(this);
    }

    public c.c.a.d1.a b(Context context) {
        String packageName = context.getPackageName();
        Intent intent = new Intent();
        intent.setClassName("com.mdid.msa", "com.mdid.msa.service.MsaKlService");
        intent.setAction("com.bun.msa.action.start.service");
        intent.putExtra("com.bun.msa.param.pkgname", packageName);
        try {
            intent.putExtra("com.bun.msa.param.runinset", true);
            context.startService(intent);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return super.b(context);
    }

    public Intent c(Context context) {
        Intent intent = new Intent();
        intent.setClassName("com.mdid.msa", "com.mdid.msa.service.MsaIdService");
        intent.setAction("com.bun.msa.action.bindto.service");
        intent.putExtra("com.bun.msa.param.pkgname", context.getPackageName());
        return intent;
    }
}
